# -*- coding: utf-8 -*-

from marshmallow import Schema
from odoo_contrib.marshmallow import fields


class CategorySchema(Schema):
    id_ = fields.Integer(attribute='id', data_key='id')
    image_url = fields.AttachmentUrl(attribute='image_id', data_key='imageUrl')
    name = fields.Str()
    desc = fields.Str()


class CategoryRepositorySchema(Schema):
    entries = fields.List(fields.Nested(CategorySchema))
    count = fields.Integer()
